﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ExaminationSys.View.Student
{
    /// <summary>
    /// Audio 的摘要说明
    /// </summary>
    public class Audio : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            if (context.Request.QueryString["mvurl"] != null)
            {
                string mvurl = context.Request.QueryString["mvurl"].ToString();
                var host = GetHost();
                context.Response.Write(String.Format("{0}/UpLoadFiles/DBQuestion/{1}", host, mvurl));
            }

        }

        private string GetHost()
        {
            var host = "http://" + HttpContext.Current.Request.Url.Host;
            var portflag = HttpContext.Current.Request.Url.IsDefaultPort;
            host += portflag ? "" : (":" + HttpContext.Current.Request.Url.Port);

            return host;
        }
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}